# -*- coding: utf-8 -*- 
import sys, os
import shutil

if __name__ == '__main__':

    rootdir = input("rootdir: ")
    # # remove meta
    # for root, dirs, files in os.walk(rootdir):
    #     for file in files:
    #         filepath = os.path.join(root,file)
    #         if (filepath.find(".svn") == -1):
    #             # print(filepath + str(filepath.find(".svn")))
    #             if (file.endswith(".meta")):
    #                 os.remove(filepath)
    #                 print(filepath)

    # # fill
    # targetFile = input("target file: ")
    # for dir in os.listdir(rootdir):
    #     if (os.path.isdir(os.path.join(rootdir, dir))) and dir.startswith("slot_view"):
    #         # print(dir)
    #         split = dir.split("_")
    #         index = int(split[2])
    #         print("index " + str(index))
    #         if (index > 5):
    #             dest = os.path.join(rootdir, dir + "/dice_beijing.png")
    #             if not os.path.exists(dest):
    #                 print("copy file success " + dest)
    #                 shutil.copyfile(targetFile, dest)

    # rename
    # for root, dirs, files in os.walk(rootdir):
    #     for file in files:
    #         #获取文件所属目录
    #         print(root)
    #         #获取文件路径
    #         print(os.path.join(root,file))

    #         if (file.endswith(".meta")):
    #             os.remove(os.path.join(root,file))

    #         os.rename(os.path.join(root,file), os.path.join(root,file.replace("card_group_", "")))
    for root, dirs, files in os.walk(rootdir):
        print(",".join(dirs))
        
    print("ok")
            